package com.snmp.smn.manager;

import java.util.List;
import java.util.TimerTask;

import com.snmp.smn.beans.Agent;
import com.snmp.smn.db.DBHelper;
import com.snmp.smn.monitors.AgentMonitor;

public class AgentsMonitorTask extends TimerTask {

	@Override
	public void run() {
		try {
			List<Agent> agents = DBHelper.getAgents();
			
			for (Agent agent : agents) {
				new AgentMonitor(agent).checkHeartBeat();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
